#include <ros/ros.h>
#include "custom_msg_pkg/CustomMessage.h"

int main(int argc, char **argv) {
    ros::init(argc, argv, "custom_message_publisher");
    ros::NodeHandle nh;

    ros::Publisher pub = nh.advertise<custom_msg_pkg::CustomMessage>("custom_topic", 10);

    ros::Rate rate(1); // 1 Hz

    while (ros::ok()) {
        custom_msg_pkg::CustomMessage msg;
        msg.data_float = 3.14;
        msg.data_string = "Hello, ROS!";

        pub.publish(msg);
        ROS_INFO("Published: Float = %f, String = %s", msg.data_float, msg.data_string.c_str());

        ros::spinOnce();
        rate.sleep();
    }

    return 0;
}

